<template>
    <div style="width: 100%;height: 100%">
        <!-- 占整个子标签页的增删改查 -->
        <list ref="list" v-show="type==='list'" @detail="detail(arguments)"></list>
        <detail v-if="type==='detail'" @save="save" :row="row"></detail>
    </div>
</template>

<script type="text/ecmascript-6">
import detail from './detail'
import list from './list'
export default {
    data: function () {
        return {
            detailType: 0, // 详情类型
            type: 'list', // type: list列表，add新增，edit编辑
            row: {}
        }
    },
    created () {
    },
    methods: {
        detail (arg) {
            this.row = arg[0]
            this.type = 'detail'
        },
        save () {
            this.type = 'list'
            this.$refs.list.getList()
        }
    },
    components: {
        list,
        detail
    }
}
</script>

<style lang="stylus" rel="stylesheet/stylus" scoped></style>
